package com.zsj;

/**
 * @auther zsj
 * @Date 2022/2/15
 **/
public class NEw {
    public static void main(String[] args) {
        System.out.println(countOdds(2,2));

    }

    public static int countOdds(int low, int high) {
        int count = 0;

        if(low%2 != 0){//如果头数为奇数就可以判断了
            count+=1;//头数为奇数 直接+1

            while(low<high){//如果low是小于high的  就可以一直加count++
                low+=2;
                if (low <= high ){
                    count++;
                }
            }

        }else if (low < high){
            return countOdds(low+1,high);
        }
        return count;
    }
}
